import Vue from 'vue'
import Vuex from 'vuex'
import { Sku } from 'vant';

Vue.use(Sku);
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    // 共享登录的用户名
    uname:null,
    // 共享登录的用户昵称
    user_name: '',
    BuyPrice:"",
    BuyTitle:'',
  },
  getters: {
  },
  mutations: {
    updateUname(state,uname){
      state.uname = uname
      // console.log('uname更新为：',uname);
    },
    updateUser_name(state, user_name) {
      state.user_name = user_name
      // console.log('user_name更新为:', user_name);
    },
    updateBuyPrice(state,BuyPrice){
      state.BuyPrice = BuyPrice
      // console.log('更新为：BuyPrice',BuyPrice);
    },
    updateBuyTitle(state,BuyTitle){
      state.BuyTitle = BuyTitle
      // console.log('BuyTitle更新为：',BuyTitle);
    }



  },
  actions: {
  },
  modules: {
  }
})
